1. Field of the Invention
The present invention relates to a real time variable bit rate encoding technique.
2. Description of the Related Art
Recent significant advances in digital signal processing technology have enabled recording of moving images on storage media and transfer of moving images through transmission lines, which were difficult to achieve with conventional technology. For this, the respective pictures that constitute a moving image are compression-encoded to significantly reduce its data amount. As a typical method of this compression encoding process, there is, for example, MPEG (Moving Picture Experts Group) scheme.
When a series of pictures are compression-encoded in accordance with the MPEG scheme with the condition of a constant bit rate, the encoded data amount differs significantly depending on a scene made up of a plurality of pictures, spatial frequency characteristics of pictures, the correlation between pictures, and the quantizer scale value. Encoded data amount control is an important technique for minimizing encoding distortion when achieving an apparatus that has such encoding characteristics.
Algorithms for realizing the encoded data amount control can be roughly classified into two types: constant bit rate encoding scheme (hereinafter referred to as “CBR scheme”) and variable bit rate encoding scheme (hereinafter referred to as “VBR scheme”). Ordinarily, the VBR scheme is known to provide decoded pictures of better image quality than the CBR scheme because the VBR scheme assigns codes adaptively depending on the encoding difficulty. The adaptive assignment of codes is realized by, for example, assigning a high bit rate to a scene with a high difficulty level of encoding and assigning a low bit rate to a scene with a low difficulty level of encoding.
Japanese Patent Laid-Open No. H9-294267 (hereinafter referred to as “Document 1”) attempts to improve image quality with the VBR scheme by solving the problems encountered with the CBR scheme. In the CBR scheme, if the encoded data amount that is generated in a GOP (Group Of Pictures) is excessively greater than the target encoded data amount of the GOP, the next target encoded data amount tries to absorb this surplus, resulting in the problem of image quality degradation. FIG. 2 shows a transition in encoded data amount generated on a GOP-by-GOP basis according to the VBR scheme of Document 1. In FIG. 2, #n (n=1, 2, . . . ) indicates the order of the GOPs.
It can be seen from FIG. 2 that the generated encoded data amount increased largely in GOP#5 because GOP#5 has a high difficulty level of encoding, and the generated encoded data amount decreased gradually from GOP#6 to GOP#9. In order to achieve such a gradual decrease in encoded data amount generated in GOPs, a target encoded data amount R(j) of GOP#j (the jth GOP) is determined using the following equations.DIFF(j)=DIFF(j−1)+B(j−1)−Tg   (1)R(j)=Tg−(1/T)×DIFF(j)   (2)In the equations, B(j) represents an encoded data amount generated in GOP#j (the jth GOP), Tg represents a target encoded data amount equally allocated to each GOP based on a given target bit rate, and T is a constant equal to or greater than 2.
As is obvious from the equations (1) and (2), the target encoded data amount R(j) is determined according to DIFF(j) that is the cumulation of the encoded data amounts generated in GOPs in the past. However, the following problem still remains in Document 1.
When determining a target encoded data amount R(j) for a GOP to be encoded, it cannot be determined as appropriate according to the difficulty level of encoding because reference is made only to the encoded data amounts generated in the already encoded GOPs, namely, the zeroth to the (j−1)th GOPs. Furthermore, in Document 1, focus is given on the target encoded data amounts of GOPs after the occurrence of the large increase in the generated encoded data amount, and merely the encoded data amount is caused to decrease gradually. The image quality degradation of decoded pictures are improved locally as compared to the CBR scheme, but it is difficult to maintain the image quality to a desired level.
Next, an encoding apparatus according to Japanese Patent Laid-Open No. 2003-61051 (hereinafter referred to as “Document 2”) will be discussed. FIG. 3 is a schematic configuration diagram of an apparatus disclosed in Document 2. According to this Document 2, a feedforward type VBR scheme is achieved by performing detection on a picture group made up of a plurality of pictures and a picture to be encoded using a means for detecting difficulty level of encoding, called “encoding difficulty information calculation units 301 and 302” in Document 2. However, even in Document 2, the following problem still remains.
The encoding difficulty information calculation units 301 and 302 require an encoding means similar to an encoding unit 305, and therefore the processing load is very heavy. Furthermore, Document 2 discloses the use of spatial activity to determine a difficulty level of encoding, but the use of spatial activity is insufficient to predict a difficulty level of encoding in the encoding unit 305, and therefore it is difficult to use special activity as information for maintaining image quality to a desired level.